package per.hnvcam.util.rws;

import java.util.HashMap;
import java.util.Map;

public class ResourceWatchingEvent {
   public static final int UNWATCHED = -1;
   public static final int REMOVED = 0;
   public static final int CREATED = 1;
   public static final int MODIFIED = 2;
   public static final int UNCHANGED = 3;
   public static final int ACCESSIBILITY_CHANGED = 4;

   private Map<String, Integer> resources;

   public ResourceWatchingEvent() {
      this.resources = new HashMap<String, Integer>();
   }

   public Map<String, Integer> getResources() {
      return this.resources;
   }

   public void addResourceEvent(String resource, int event) {
      this.resources.put(resource, event);
   }

   public int getResourceEvent(String resource) {
      if (this.resources.containsKey(resource)) {
         return this.resources.get(resource);
      }
      return UNWATCHED;
   }
}
